package com.webside.points.service.impl;


import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.webside.points.mapper.UserMapper;
import com.webside.points.model.UserEntity;
import com.webside.points.service.UserService;
import com.webside.points.wechat.BeanFactory;

@Service("userService")
public class UserServiceImpl implements UserService{

	
	@Autowired
	UserMapper userMapper;
	
	 public static UserService getInstance(){
			return (UserService) BeanFactory.getBean("userService");
	  }
	
	@Override
	public int insert(UserEntity userEntity) {
		return userMapper.insert(userEntity);
	}

	@Override
	public UserEntity findByOpenId(String openId) {
		return userMapper.findByOpenId(openId);
	}

	@Override
	public UserEntity findById(int id) {
		return userMapper.findById(id);
	}

	@Override
	public int updateExpertId(UserEntity userEntity) {
		return userMapper.updateExpertId(userEntity);
	}

	@Override
	public int updatePayment(UserEntity userEntity) {
		return userMapper.updatePayment(userEntity);
	}

	@Override
	public UserEntity findExpertId(int expertId) {
		return userMapper.findExpertId(expertId);
	}

	@Override
	public UserEntity findByUnionId(String unionId) {
		return userMapper.findByUnionId(unionId);
	}

	@Override
	public int updateOpenId(UserEntity userEntity) {
		return userMapper.updateOpenId(userEntity);
	}

	@Override
	public List<UserEntity> findAll(UserEntity userEntity) {
		return userMapper.findAll(userEntity);
	}

	@Override
	public int findCount(UserEntity userEntity) {
		return userMapper.findCount(userEntity);
	}

	@Override
	public int updateStatus(UserEntity userEntity) {
		return userMapper.updateStatus(userEntity);
	}

	@Override
	public List<UserEntity> findMangeStatus() {
		return userMapper.findMangeStatus();
	}

	@Override
	public int updateStudyNumber(UserEntity userEntity) {
		return userMapper.updateStudyNumber(userEntity);
	}

}
